namespace GroupSix.Application.Dtos;

/// <summary>
/// 系统设置DTO
/// </summary>
public class SystemSettingDto
{
    /// <summary>
    /// 设置ID
    /// </summary>
    public Guid Id { get; set; }

    /// <summary>
    /// 设置键
    /// </summary>
    public string SettingKey { get; set; } = string.Empty;

    /// <summary>
    /// 设置值
    /// </summary>
    public string SettingValue { get; set; } = string.Empty;

    /// <summary>
    /// 设置描述
    /// </summary>
    public string Description { get; set; } = string.Empty;

    /// <summary>
    /// 设置类型
    /// </summary>
    public string SettingType { get; set; } = "string";

    /// <summary>
    /// 是否系统级设置
    /// </summary>
    public bool IsSystemLevel { get; set; }

    /// <summary>
    /// 设置分组
    /// </summary>
    public string Group { get; set; } = "general";

    /// <summary>
    /// 排序
    /// </summary>
    public int SortOrder { get; set; }

    /// <summary>
    /// 是否只读
    /// </summary>
    public bool IsReadOnly { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime CreatedAt { get; set; }

    /// <summary>
    /// 更新时间
    /// </summary>
    public DateTime UpdatedAt { get; set; }
}

/// <summary>
/// 创建系统设置请求DTO
/// </summary>
public class CreateSystemSettingRequestDto
{
    /// <summary>
    /// 设置键
    /// </summary>
    public string SettingKey { get; set; } = string.Empty;

    /// <summary>
    /// 设置值
    /// </summary>
    public string SettingValue { get; set; } = string.Empty;

    /// <summary>
    /// 设置描述
    /// </summary>
    public string Description { get; set; } = string.Empty;

    /// <summary>
    /// 设置类型
    /// </summary>
    public string SettingType { get; set; } = "string";

    /// <summary>
    /// 是否系统级设置
    /// </summary>
    public bool IsSystemLevel { get; set; }

    /// <summary>
    /// 设置分组
    /// </summary>
    public string Group { get; set; } = "general";

    /// <summary>
    /// 排序
    /// </summary>
    public int SortOrder { get; set; }

    /// <summary>
    /// 是否只读
    /// </summary>
    public bool IsReadOnly { get; set; }
}

/// <summary>
/// 更新系统设置请求DTO
/// </summary>
public class UpdateSystemSettingRequestDto
{
    /// <summary>
    /// 设置值
    /// </summary>
    public string SettingValue { get; set; } = string.Empty;

    /// <summary>
    /// 设置描述
    /// </summary>
    public string Description { get; set; } = string.Empty;

    /// <summary>
    /// 变更原因
    /// </summary>
    public string ChangeReason { get; set; } = string.Empty;
}

/// <summary>
/// 系统设置查询DTO
/// </summary>
public class SystemSettingQueryDto
{
    /// <summary>
    /// 设置键（模糊查询）
    /// </summary>
    public string? SettingKey { get; set; }

    /// <summary>
    /// 设置分组
    /// </summary>
    public string? Group { get; set; }

    /// <summary>
    /// 是否系统级设置
    /// </summary>
    public bool? IsSystemLevel { get; set; }

    /// <summary>
    /// 页码
    /// </summary>
    public int Page { get; set; } = 1;

    /// <summary>
    /// 页大小
    /// </summary>
    public int PageSize { get; set; } = 20;
}

/// <summary>
/// 系统设置变更日志DTO
/// </summary>
public class SystemSettingLogDto
{
    /// <summary>
    /// 日志ID
    /// </summary>
    public Guid Id { get; set; }

    /// <summary>
    /// 设置键
    /// </summary>
    public string SettingKey { get; set; } = string.Empty;

    /// <summary>
    /// 旧值
    /// </summary>
    public string OldValue { get; set; } = string.Empty;

    /// <summary>
    /// 新值
    /// </summary>
    public string NewValue { get; set; } = string.Empty;

    /// <summary>
    /// 变更原因
    /// </summary>
    public string ChangeReason { get; set; } = string.Empty;

    /// <summary>
    /// 操作类型
    /// </summary>
    public string OperationType { get; set; } = string.Empty;

    /// <summary>
    /// 操作人用户名
    /// </summary>
    public string OperatorName { get; set; } = string.Empty;

    /// <summary>
    /// IP地址
    /// </summary>
    public string IpAddress { get; set; } = string.Empty;

    /// <summary>
    /// 操作时间
    /// </summary>
    public DateTime CreatedAt { get; set; }
} 